New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@pluginjs/keyboard

Package Overview
Dependencies
Maintainers
2
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pluginjs/keyboard

A workflow for modern frontend development.

  • 0.7.21
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-75.86%
Maintainers
2
Weekly downloads
 
Created
Source

Keyboard

npm package

keyboard is a utility JavaScript library for keyboard event.

Introduction

Installation

Yarn
yarn add @pluginjs/keyboard
NPM
npm i @pluginjs/keyboard

Getting Started

CDN:

Development:

<script src="https://unpkg.com/@pluginjs/keyboard/dist/keyboard.js"></script>

Production:

<script src="https://unpkg.com/@pluginjs/keyboard/dist/keyboard.min.js"></script>

API

registerEvent

mount keydown keyup event listener on this.element.

handler

Parameters

| Name | Type | Description | |||-| | e | Event | |

on

Parameters

| Name | Type | Description | |||-| | action | String | | | key | String | | | func | Function | |

Returns

| Name | Type | Description | |||-| | instance | Object | this |

off

Parameters

| Name | Type | Description | |||-| | action | String | | | key | String | | | func | Function | |

Returns

| Name | Type | Description | |||-| | instance | Object | this |

dispatch

Parameters

| Name | Type | Description | |||-| | toggle | Boolean | | | action | String | | | key | String | | | func | Function | |

Returns

| Name | Type | Description | |||-| | instance | Object | this |

parseKeys

Parameters

| Name | Type | Description | |||-| | keys | String[] | |

Returns

| Name | Type | Description | |||-| | newKeys | String[] | |

processKey

Parameters

| Name | Type | Description | |||-| | key | String | |

Returns

| Name | Type | Description | |||-| | newKeys | String[] | |

processModifiers

Parameters

| Name | Type | Description | |||-| | key | String | |

Returns

| Name | Type | Description | |||-| | modifiers | Function[] | |

distribute

Parameters

| Name | Type | Description | |||-| | action | String | | | key | String | | | func | Function | |

Returns

| Name | Type | Description | |||-| | instance | Object | this |

getKeyName

Parameters

| Name | Type | Description | |||-| | keyCode | String | |

Returns

| Name | Type | Description | |||-| | keyName | String | |

getKeyCode

Parameters

| Name | Type | Description | |||-| | keyName | String | |

Returns

| Name | Type | Description | |||-| | keyCode | String | |

up

Parameters

| Name | Type | Description | |||-| | key | String | | | func | Function | |

Returns

| Name | Type | Description | |||-| | instance | Object | this |

down

Parameters

| Name | Type | Description | |||-| | key | String | | | func | Function | |

Returns

| Name | Type | Description | |||-| | instance | Object | this |

Browser support

Tested on all major browsers.

IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
Opera
Opera
IE11, Edgelast 2 versionslast 2 versionslast 2 versionslast 2 versions

License

@pluginjs/keyboard is Licensed under the GPL-v3 license.

If you want to use @pluginjs/keyboard project to develop commercial sites, themes, projects, and applications, the Commercial license is the appropriate license. With this option, your source code is kept proprietary.

For purchase an Commercial License, contact us purchase@thecreation.co.

Copyright (C) 2018 Creation Studio Limited.

FAQs

Package last updated on 15 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc